package com.yl.chainStore.control.system


import com.yl.chainStore.control.BaseCtrl
import com.yl.common.control.ResponseBody
import com.yl.common.control.returnSuccess
import com.yl.users.common.util.permListToTree
import com.yl.users.entity.SysPermissions
import com.yl.users.services.ISystemService
import org.springframework.transaction.annotation.Transactional
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*

/**
 * 权限模板视图 暂时不用
 */
@RestController
@RequestMapping("sys/perm")
open class SysPermissionsController(
	private val iSystemService: ISystemService,
) : BaseCtrl() {

	/**
	 * 权限树形列表
	 */
	@RequestMapping("getPermTree")
	@Transactional
	open fun getPermTree():ResponseBody{
		val permList = iSystemService.getPermList()
		return returnSuccess(permListToTree(permList,0L))
	}




}
